import { connect } from 'react-redux'
import Change from './Change'
function Child(props) {
  console.log(props)
  return <>
    <h1 style={{ color: props.color }}>{props.name}---{props.age}</h1>
    <Change />
  </>
}
Child = connect((state) => {
  // state 对应其实就是redux getState获取到的哪个state
  console.log('connect', state)
  return {
    name: state.userInfo.name,
    age: state.userInfo.age,
    color: state.colorInfo.color
  }
})(Child)
export default Child